﻿using Microsoft.Practices.Unity;

namespace RG.Common.WPF.Filters.ToolBarFilters
{
    /// <summary>
    /// Фильтр со строковым параметром
    /// </summary>
    [SupportDataBinding]
    public class FilterStringFrameVM : FilterBaseParamVM<string>
    {   
        public FilterStringFrameVM(IUnityContainer cfg):base(cfg)
        {
        }

        public override void ClearValueQuiet()
        {
            Value = string.Empty;
        }

        public override bool ValueEmpty()
        {
            return  string.IsNullOrEmpty(value);
        }

        public string FormattedValue
        {
            get
            {
                return ValueEmpty() ? EmptyText : Value;
            }
        }


        protected override string ReturnDefaultEmptyValue()
        {
            return null;
        }
    }
}
